﻿using System;
using System.Windows.Media;
using VNet.VisiSuite.Common.Logger;

namespace VNet.VisiSuite.Common.Helpers
{
    public class ColorHelper
    {
        public static Color StringToColor(string clr, Color default_color)
        {
            Color color = default_color;
            try
            {
                if (!clr.StartsWith("#"))
                    clr = "#" + clr;
                color = Infragistics.ColorConverter.FromString(clr.TrimEnd(' '));
            }
            catch (Exception ex)
            {
                FileLog.Equals("stringToColor() - ", ex);
            }
            return color;
        }
    }
}
